﻿using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace 电驱线暗灯板.Models
{
    //[SugarTable(TableName = "Log_DataAcquisition")]
    public class LogData
    {
        [Key]
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "机器的名字",ColumnName ="MachineName")]
        public string? 机器的名字 { get; set; }
        [SugarColumn( ColumnDataType = "timestamp without time zone", ColumnDescription = "日志记录时间", ColumnName = "LoggedDateTime")]//DefaultValue = "CURRENT_TIMESTAMP",
        public DateTime 记录时间 { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "日志级别", ColumnName = "Level")]
        public string? 级别 { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "日志消息内容", ColumnName = "Message")]
        public string? 消息内容 { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "产生日志信息的对象", ColumnName = "Logger")]
        public string? 日志信息对象 { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "产生日志信息的方法或函数", ColumnName = "Callsite")]
        public string? 日志信息方法 { get; set; }
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "异常信息", ColumnName = "Exception")]
        public string? 异常信息 { get; set; }
        

    }
    public static class LogName
    {
        public static readonly  string HTTP请求的完成情况 = "log_http请求的完成情况";
        public static readonly string 控制器操作执行情况 = "log_控制器操作执行情况";
        public static readonly string Api执行日志 = "log_Api执行日志";
        public static readonly string Job执行日志 = "log_Job执行日志";
        public static readonly string 系统日志 = "log_系统日志";
        public static readonly string 其它日志 = "log_其它日志";
    }
}
